import { mapGetters } from 'vuex'
import commonMixins from "./common"
import { dislodgePx } from "@/utils/util"
export default {
	mixins:[commonMixins],
	data(){
		return {
			ResultHeight:200,
			tableHeight:150,
		}
	},
	computed: {
    	...mapGetters([
      		'mainContentHeight'
    	])
  	},
	methods:{
		//设置系统菜单内容区域高度
		setSize(){
	      	var search =this.$refs.adminContentSearch ? this.getStyle(this.$refs.adminContentSearch) : {};
	      	var tools =this.$refs.adminContentTools ? this.getStyle(this.$refs.adminContentTools) : {};
	      	var page =this.$refs.adminContentPagination ? this.getStyle(this.$refs.adminContentPagination) : {};
	      	console.log("%c获取搜索栏和工具栏的样式","background:#000;color:#fff")
	      	console.log(search)
	      	console.log(tools)
	      	var search_h = dislodgePx(search.height) || 0;
	      	var search_mt = dislodgePx(search.marginTop) || 0;
	      	var search_mb = dislodgePx(search.marginBottom) || 0;
	      	var tools_h = dislodgePx(tools.height) || 0;
	      	var tools_mt = dislodgePx(tools.marginTop) || 0;
	      	var tools_mb = dislodgePx(tools.marginBottom) || 0;

	      	var result = this.mainContentHeight-(search_h+search_mt+search_mb+tools_h+tools_mt+tools_mb);
	    	
	    	this.ResultHeight = result>200 ? result : 200;
	    	var page_h = dislodgePx(page.height) || 0;
	      	var page_mt = dislodgePx(page.marginTop) || 0;
	      	var page_mb = dislodgePx(page.marginBottom) || 0;
	      	this.tableHeight = this.ResultHeight-(page_h+page_mt+page_mb+30);
	    },
	}
}